
$(function(){
	testLoadVoteAndSurvey();
});

function submitChat(chat){
	info("submit chat", chat);
}
	
function testLoadVoteAndSurvey(){
	
	var testData = '<module name="vote">'
	  +'<command version="2" id="252227b4-16bc-41d5-895a-b47a585b8a8c" type="question" skip="true" timestamp="">'
	  +'<subject><![CDATA[天空是什么颜色的？？]]></subject>'
	  +' <question id="5a5723a7-4fb8-4416-a934-75f0e48f9622" type="single" answer="1">'
	  +'  <subject><![CDATA[天空是什么颜色的？？]]></subject>'
	  +'  <item id="5753640" correct="true"><![CDATA[蓝色]]></item>'
	  +'  <item id="5757937" correct="false"><![CDATA[红色]]></item>'
	  +'   <item id="5762234" correct="false">白色</item>'
	  +' </question>'
	  +'  <question id="78ad83a4-70fa-4b77-85a7-77a05c5b38f1" type="multi" answer="1,2">'
	  +'    <subject><![CDATA[你的爱好？]]></subject>'
	  +'    <item id="5791671" correct="true"><![CDATA[篮球]]></item>'
	  +'    <item id="5796125" correct="true"><![CDATA[足球]]></item>'
	  +'    <item id="5803125" correct="false"><![CDATA[羽毛球]]></item>'
	  +'  </question>'
	  +'  <question id="016313cc-aaa5-4c9d-b9c8-00a0db950839" type="text" answer="">'
	  +'    <subject><![CDATA[请阐述对当前房价的看法]]></subject>'
	  +'  </question>'
	  +' </command>'
	  +'</module>';
	
	setTimeout(function(){loadVoteAndSurveys(analysisVote(testData));}, 100);
	
	var testData2 = '<module name="vote">'
		  +'<command version="2" id="252227b4-16bc-41d5-895a-b47a585b8a8c" type="result" skip="true" timestamp="">'
		  +'<subject><![CDATA[天空是什么颜色的？？]]></subject>'
		  +' <question id="5a5723a7-4fb8-4416-a934-75f0e48f9622" type="single" answer="1" total="15">'
		  +'  <subject><![CDATA[天空是什么颜色的？？]]></subject>'
		  +'  <item id="5753640" correct="true" total="5"><![CDATA[蓝色]]></item>'
		  +'  <item id="5757937" correct="false" total="10"><![CDATA[红色]]></item>'
		  +'   <item id="5762234" correct="false" total="0">白色</item>'
		  +' </question>'
		  +'  <question id="78ad83a4-70fa-4b77-85a7-77a05c5b38f1" type="multi" answer="1,2" total="0">'
		  +'    <subject><![CDATA[你的爱好？]]></subject>'
		  +'    <item id="5791671" correct="true" total="0"><![CDATA[篮球]]></item>'
		  +'    <item id="5796125" correct="true" total="0"><![CDATA[足球]]></item>'
		  +'    <item id="5803125" correct="false" total="0"><![CDATA[羽毛球]]></item>'
		  +'  </question>'
		  +'  <question id="016313cc-aaa5-4c9d-b9c8-00a0db950839" type="text" answer="answer">'
		  +'    <subject><![CDATA[请阐述对当前房价的看法]]></subject>'
		  +'  </question>'
		  +' </command>'
		  +'</module>';
		
		setTimeout(function(){loadVoteAndSurveys(analysisVoteResult(testData2));}, 2000);
}

